package com.code.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.code.service.FruitService;
import com.code.service.BrandService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/count")
public class CountController {
    @Reference
    BrandService brandService;

//    @PreAuthorize("hasRole('ROLE_ADMIN')")
    @RequestMapping("tongji")
    public List<Map> tongji() {
        List<Map> map = brandService.tongji();
        return map;
    }

//    @RequestMapping("zzt")
//    public List<Map> zzt() {
//        List<Map> map = fruitService.tongji();
//        return map;
//    }
//    @RequestMapping("zhe")
//    public List<Map> zhe() {
//        List<Map> map = fruitService.tongji();
//        return map;
//    }

    @RequestMapping("two")
    public Map two() {
        List<Map> shiyong = brandService.tongji();
//        List<Map> tuidan = fruitService.twotongji();
        Map map = new HashMap<>();
        map.put("aa",shiyong);
        map.put("bb",shiyong);
        return map;
    }
}
